package com.vegetable.modules.entity.inbound;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import com.vegetable.modules.entity.stock.Stock;
import com.vegetable.modules.entity.stock.to.StockFlowDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 其他入库表
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="OtherDelivery对象", description="其他入库表")
public class OtherDelivery extends BaseEntity {

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "生产者ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long producerId;

    @ApiModelProperty(value = "订单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date orderTime;

    @ApiModelProperty(value = "状态0未入库；1已入库")
    private Integer state;

    @ApiModelProperty(value = "文档编号")
    private String docNo;

    @ApiModelProperty(value = "商品名拼接")
    private String commodityNames;

    @ApiModelProperty(value = "工人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long workerId;

    @ApiModelProperty(value = "工人姓名")
    private String workerName;

    @ApiModelProperty(value = "数量")
    private Integer number;

    @ApiModelProperty(value = "重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "创建者ID")
    private Long createUserId;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "商品明细")
    @TableField(exist = false)
    private List<OtherDeliveryDetail> commodities;

    @ApiModelProperty(value = "其他费用")
    @TableField(exist = false)
    private List<OrderCost> costs;

    @ApiModelProperty(value = "销售出库详情")
    @TableField(exist = false)
    private List<StockFlowDTO> stockFlows;

    @ApiModelProperty(value = "库存详情")
    @TableField(exist = false)
    private List<Stock> stocks;

    private BigDecimal money;

}
